package pers.xiaojun.boot.module.system.constants;

import pers.xiaojun.boot.common.pojo.BusinessCode;

/**
 * 系统模块业务代码
 *
 * @author xiaojun
 * @since 2025-10-05
 */
public interface BusinessCodeConstants {

    /* ====== 系统管理模块 001 ====== */

    BusinessCode AUTH_LOGIN_BED_CREDENTIALS = BusinessCode.of(1_001_001, "用户名或密码错误");
    BusinessCode AUTH_CAPTCHA_NOT_EXISTS = BusinessCode.of(1_001_010, "验证码不存在");
    BusinessCode AUTH_CAPTCHA_BED_CREDENTIALS = BusinessCode.of(1_001_011, "验证码错误");

    // 100-149：OAuth 2.0 错误
    BusinessCode OAUTH2_CLIENT_NOT_EXISTS = BusinessCode.of(1_001_101, "客户端不存在");
    BusinessCode OAUTH2_SECRET_NOT_MATCH = BusinessCode.of(1_001_102, "客户端密钥不匹配");
    BusinessCode OAUTH2_REDIRECT_URI_INVALID = BusinessCode.of(1_001_103, "无效重定向地址");
    BusinessCode OAUTH2_AUTHORIZED_GRANT_TYPE_INVALID = BusinessCode.of(1_001_104, "无效授权方式");
    BusinessCode OAUTH2_SCOPES_INVALID = BusinessCode.of(1_001_105, "无效授权空间");
    BusinessCode OAUTH2_REFRESH_TOKEN_INVALID = BusinessCode.of(1_001_106, "无效刷新令牌");
    BusinessCode OAUTH2_REFRESH_TOKEN_CLIENT_NOT_MATCH = BusinessCode.of(1_001_107, "刷新令牌与客户端不匹配");
    BusinessCode OAUTH2_AUTHORIZATION_CODE_INVALID = BusinessCode.of(1_001_108, "授权码无效或已过期");
    BusinessCode OAUTH2_CLIENT_OR_SECRET_INVALID = BusinessCode.of(1_001_109, "客户端ID或密钥无效");

    // 150-199: 菜单错误
    BusinessCode MENU_PARENT_NOT_MYSELF = BusinessCode.of(1_001_150, "不能设置菜单为自己的父菜单");
    BusinessCode MENU_PARENT_NOT_EXISTS = BusinessCode.of(1_001_151, "父菜单不存在");
    BusinessCode MENU_PARENT_TYPE_NOT_MATCH = BusinessCode.of(1_001_152, "父菜单类型不匹配");
    BusinessCode MENU_NAME_EXISTS = BusinessCode.of(1_001_203, "菜单名称已存在");
    BusinessCode MENU_COMPONENT_NAME_EXISTS = BusinessCode.of(1_001_153, "组件名称已存在");
    BusinessCode MENU_EXISTS_CHILDREN = BusinessCode.of(1_001_154, "菜单存在子菜单，请先删除子菜单");
    BusinessCode MENU_NOT_EXISTS = BusinessCode.of(1_001_154, "菜单不存在");

    // 200-249: 角色错误
    BusinessCode ROLE_NOT_SET_SUPER_ADMIN = BusinessCode.of(1_001_200, "角色代码无法设置为超级管理员");
    BusinessCode ROLE_NAME_EXISTS = BusinessCode.of(1_001_201, "角色名称已存在");
    BusinessCode ROLE_CODE_EXISTS = BusinessCode.of(1_001_202, "角色代码已存在");
    BusinessCode ROLE_NOT_EXISTS = BusinessCode.of(1_001_203, "角色不存在");
    BusinessCode ROLE_SYSTEM_NOT_OPERABLE = BusinessCode.of(1_001_204, "内置角色无法操作");

    // 250-299：部门错误
    BusinessCode DEPT_NAME_EXISTS = BusinessCode.of(1_001_300, "部门名称已存在");
    BusinessCode DEPT_PARENT_NOT_EXISTS = BusinessCode.of(1_001_301, "上级部门不存在");
    BusinessCode DEPT_NOT_EXISTS = BusinessCode.of(1_001_302, "部门不存在");
    BusinessCode DEPT_HAS_CHILDREN = BusinessCode.of(1_001_303, "部门存在下级部门，请先删除下级部门");
    BusinessCode DEPT_PARENT_NOT_MYSELF = BusinessCode.of(1_001_304, "不能设置上级部门为自己");
    BusinessCode DEPT_DISABLE = BusinessCode.of(1_001_305, "部门已被禁用");

    // 300-349：用户错误
    BusinessCode USER_NOT_EXISTS = BusinessCode.of(1_001_300, "用户不存在");
    BusinessCode USER_USERNAME_EXISTS = BusinessCode.of(1_001_301, "账号已存在");
    BusinessCode USER_EMAIL_EXISTS = BusinessCode.of(1_001_302, "邮箱已存在");
    BusinessCode USER_MOBILE_EXISTS = BusinessCode.of(1_001_303, "手机号已存在");

    // 350-399：岗位错误
    BusinessCode POST_NOT_EXISTS = BusinessCode.of(1_001_350, "岗位不存在");
    BusinessCode POST_NAME_EXISTS = BusinessCode.of(1_001_351, "岗位名称已存在");
    BusinessCode POST_CODE_EXISTS = BusinessCode.of(1_001_352, "岗位代码已存在");

    // 400-449：字典错误
    BusinessCode DICT_NAME_EXISTS = BusinessCode.of(1_001_400, "字典名称已存在");
    BusinessCode DICT_TYPE_EXISTS = BusinessCode.of(1_001_401, "字典类型已存在");
    BusinessCode DICT_NOT_EXISTS = BusinessCode.of(1_001_402, "字典不存在");
    BusinessCode DICT_TYPE_NOT_EXISTS = BusinessCode.of(1_001_403, "字典类型不存在");
    BusinessCode DICT_LABEL_EXISTS = BusinessCode.of(1_001_404, "字典标签已存在");
    BusinessCode DICT_DATA_EXISTS = BusinessCode.of(1_001_404, "字典数据不存在");

    // 450-499：租户错误
    BusinessCode TENANT_NOT_EXISTS = BusinessCode.of(1_001_450, "租户不存在");
    BusinessCode TENANT_NAME_EXISTS = BusinessCode.of(1_001_451, "租户名称已存在");
    BusinessCode TENANT_WEBSITE_EXISTS = BusinessCode.of(1_001_452, "租户域名已存在");
    BusinessCode TENANT_DISABLED = BusinessCode.of(1_001_453, "租户已禁用");
    BusinessCode TENANT_EXPIRED = BusinessCode.of(1_001_454, "租户已到期");

    BusinessCode TENANT_PACKAGE_NOT_EXISTS = BusinessCode.of(1_001_480, "租户套餐不存在");
    BusinessCode TENANT_PACKAGE_NAME_EXISTS = BusinessCode.of(1_001_481, "租户套餐名称已存在");
    BusinessCode TENANT_PACKAGE_DISABLED = BusinessCode.of(1_001_482, "租户套餐已禁用");



}
